package myCommunity.biz.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.hibernate3.HibernateTemplate;
import org.springframework.stereotype.Service;

import myCommunity.biz.CommunityForumBiz;
import myCommunity.entity.CommunityForum;

@Service
public class CommunityForumBizImpl implements CommunityForumBiz{

	@Autowired
	private HibernateTemplate hibernateTemplate;
	@Override
	public List<CommunityForum> getAll() {
		return (List<CommunityForum>) hibernateTemplate.find("from CommunityForum");
	}
	@Override
	public List<CommunityForum> fetchByParentId(int parentId) {
		return (List<CommunityForum>) hibernateTemplate.find("from CommunityForum where parentId=?",parentId);
	}
	
}
